import UnityEngine
# //////////////////////////////////////////////////////
# ///摄影机绕[min,max]角度旋转.
# //////////////////////////////////////////////////////

class CameraRotate (MonoBehaviour): 
	public range as Vector2 = Vector2(-45,45)
	dir as int = 1
	public speed = 0.15
	def Start ():
		pass
	
	def Update ():
		y = transform.localEulerAngles.y
		if y < range.x or y > range.y:
			dir *= -1;
		dirVec = dir * transform.InverseTransformDirection(Vector3(0,speed,0))
		
		transform.Rotate(dirVec)
	